﻿using System.Collections.Generic;
using OpenLS.Spreadsheet.Extensibility;

namespace OpenLS.Spreadsheet
{
    public abstract class SimpleRange: Range
    {
        internal new abstract SimpleRange ProjectedSimple(Worksheet worksheet, CellRelativeAddress range);


        internal override IEnumerable<Range> GetRowRanges(RangeType type)
        {
            foreach (Row row in GetRows())
                yield return GetRowRange(row.Index - TopLeftCell.Row.Index, type);
        }

        internal override IEnumerable<Range> GetColumnRanges(RangeType type)
        {
            foreach (Column column in GetColumns())
                yield return GetColumnRange(column.Index - TopLeftCell.Column.Index, type);
        }
    }
}